html, body {
  height: 100%;
}

/* 参考页面样式 */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: 'Microsoft YaHei', sans-serif;
  background-color: #f5f5f5;
}

.main-header {
  background-color: #2c3e50;
  color: white;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 40px;
  margin-right: 10px;
}

.logo-text {
  font-size: 18px;
  margin: 0;
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li {
  margin: 0 10px;
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  padding: 5px 10px;
  border-radius: 3px;
  transition: background-color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
  background-color: #34495e;
}

.user-actions {
    display: flex;
    align-items: center;
}

.username {
  margin-right: 10px;
  color: #ecf0f1;
}

.logout-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
    cursor: pointer;
  transition: background-color 0.3s;
}

.logout-btn:hover {
  background-color: #c0392b;
}

.main-content {
  flex: 1;
  padding: 20px;
}

.main-footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
}

/* 参考页面特定样式 */
.reference-container {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  height: calc(100vh - 100px);
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  min-height: 0;
}

.categories-container, .category-list {
  padding: 18px 8px 18px 18px;
  background: #fff;
  min-width: 180px;
  max-width: 220px;
}

.content-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 0 18px 0 0;
  background: none;
}

.content-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.main-content-row {
  display: grid;
  grid-template-columns: 220px 1fr 340px;
  gap: 24px;
  height: 100%;
  min-height: 0;
}

.detail-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f9fafd;
  border-radius: 12px;
  padding: 32px 36px 32px 36px;
  margin: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  align-items: flex-start;
}

.ai-assistant-container {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  background: #f7faff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.06);
  padding: 24px 20px 18px 20px;
}

.categories-container h2,
.signs-container h2 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  color: #2c3e50;
}

.category-list {
  list-style: none;
  padding: 10px 0 10px 0;
}

.category-item {
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
  color: #333;
  border-left: 3px solid transparent;
}

.category-item:hover {
  background-color: #f5f7fa;
  border-left-color: #3498db;
}

.category-item.active {
  background-color: #ebf5ff;
  border-left-color: #3498db;
  color: #3498db;
  font-weight: bold;
}

.signs-list {
    display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 5px;
}

.sign-item {
  background-color: #fff;
  border-radius: 8px;
  font-size: 1.1rem;
  padding: 10px 0;
  background: #f7faff;
  border: 1.5px solid #e6eaf0;
  margin-bottom: 2px;
  transition: background 0.2s, border 0.2s, color 0.2s;
}

.sign-item:hover {
  background: #eaf4ff;
  color: #1976d2;
  border: 1.5px solid #90caf9;
}

.sign-item.active {
  background: #e3f0ff;
  color: #1976d2;
  border: 2px solid #1976d2;
}

.sign-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 10px;
  background-color: #f1f1f1;
}

.sign-item-name {
  font-weight: bold;
  margin-bottom: 5px;
  color: #333;
}

.detail-header {
  width: 100%;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #e6eaf0;
}

#signWord {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
    margin: 0;
  letter-spacing: 2px;
}

.detail-content {
  width: 100%;
  margin-top: 10px;
}

#signDescription {
  font-size: 1.15rem;
  color: #444;
    line-height: 1.8;
  margin-top: 10px;
  padding: 8px 0 0 0;
  min-height: 80px;
}

#signDescription p {
  margin-bottom: 8px;
  padding-left: 0;
}

.sign-steps {
  margin-top: 15px;
    padding-left: 20px;
}

.sign-steps li {
  margin-bottom: 10px;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #999;
  font-style: italic;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .reference-container {
    grid-template-columns: 160px 1fr;
  }
  .content-area {
    padding: 0 6px 0 0;
  }
  .main-content-row {
    gap: 12px;
  }
  .detail-area, .ai-assistant-container {
    padding: 18px 10px;
  }
}

@media (max-width: 900px) {
    .reference-container {
        grid-template-columns: 1fr;
    height: auto;
  }
  .content-area {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }
  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }
  .main-content-row {
    flex-direction: column;
    gap: 12px;
  }
  .detail-area, .ai-assistant-container {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
  }
}

.signs-dropdown {
  width: 220px;
  height: 38px;
  font-size: 1.1rem;
  border-radius: 6px;
  border: 1.5px solid #e6eaf0;
  padding: 0 10px;
  background: #f7faff;
  color: #1976d2;
  outline: none;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.04);
  transition: border 0.2s, box-shadow 0.2s;
}
.signs-dropdown:focus {
  border: 2px solid #1976d2;
  box-shadow: 0 0 0 2px #90caf9;
}
.signs-dropdown option {
  color: #333;
  background: #fff;
  font-size: 1.1rem;
}

.ai-assistant-header {
  font-size: 1.18rem;
  font-weight: 600;
  color: #1976d2;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.ai-chat-history {
  flex: 1;
  width: 100%;
  min-height: 60px;
  max-height: 100%;
  overflow-y: auto;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e6eaf0;
  padding: 10px 12px;
  font-size: 1rem;
  color: #333;
  word-break: break-all;
}
.ai-chat-message {
  margin-bottom: 8px;
  line-height: 1.7;
}
.ai-chat-message.user {
  color: #1976d2;
  font-weight: 500;
}
.ai-chat-message.assistant {
  color: #388e3c;
}
.ai-chat-input-row {
  width: 100%;
  display: flex;
  gap: 8px;
}
.ai-chat-input {
  flex: 1;
  height: 36px;
  border-radius: 6px;
  border: 1.5px solid #e6eaf0;
  font-size: 1rem;
  padding: 0 10px;
  outline: none;
  background: #fff;
  transition: border 0.2s;
}
.ai-chat-input:focus {
  border: 2px solid #1976d2;
}
.ai-chat-send-btn {
  height: 36px;
  min-width: 60px;
  border-radius: 6px;
  border: none;
  background: #1976d2;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
    }
.ai-chat-send-btn:hover {
  background: #1565c0;
}

.main-content-row, .ai-assistant-container {
  min-height: 0;
}

.ai-chat-history {
  max-height: 100%;
}

.signs-list-box {
  background: #f7faff;
  border: 1.5px solid #e6eaf0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.06);
  padding: 12px 0 12px 0;
  margin-top: 8px;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  min-width: 0;
}

.signs-list-title {
  font-size: 1.15rem;
  font-weight: bold;
  color: #1976d2;
  padding: 0 18px 8px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid #e6eaf0;
}

.signs-list-box .sign-item {
  padding: 8px 18px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  color: #1976d2;
  background: none;
  border: none;
  text-align: left;
}

.signs-list-box .sign-item:hover,
.signs-list-box .sign-item.active {
  background: #eaf4ff;
  color: #1565c0;
  font-weight: bold;
} 